<template>
  <div>
    <app-header v-show="flag"></app-header>
    <router-view />
    <app-footer v-show="flag"></app-footer>
  </div>
</template>
<script>
import Header from '@/components/mian/Header'
import Footer from '@/components/mian/Footer'

export default {
    data() {
        return {
            flag:true
        }
    },
    components:{
        "app-header":Header,
        "app-footer":Footer
        
    },
    
    watch: {
        $route(to, from) {
            // to 和 from 都是 路由信息对象
            if(to.path=='/login'){
                this.flag = false
            }
            console.log();
        }
    }
}
</script>